﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridBound.aspx.cs" Inherits="GridBound" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:GridView ID="gvProduct" runat="server" AutoGenerateColumns="False" DataKeyNames="ProductId" DataSourceID="ldsProduct" AllowPaging="True">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="True" OnCheckedChanged="chkAll_CheckedChanged" Text="全选" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkItem" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="ProductId" HeaderText="商品编号" InsertVisible="False" ReadOnly="True" SortExpression="ProductId" />
                    <asp:BoundField DataField="ListPrice" HeaderText="商品单价" SortExpression="ListPrice" />
                    <asp:BoundField DataField="Name" HeaderText="商品名称" SortExpression="Name" />
                    <asp:ImageField DataImageUrlField="Image" HeaderText="商品图片">
                        <ControlStyle Width="35px" />
                    </asp:ImageField>
                    <asp:CommandField ShowEditButton="True" />
                </Columns>
            </asp:GridView>
            <asp:Button ID="btnSubmit" runat="server" Text="确定" OnClick="btnSubmit_Click" />
            <asp:Label ID="lblProductId" runat="server" ></asp:Label>
            <asp:LinqDataSource ID="ldsProduct" runat="server" ContextTypeName="MyPetShopDataContext" EntityTypeName="" TableName="Product" EnableUpdate="true" EnableDelete="true"></asp:LinqDataSource>
        </div>
    </form>
</body>
</html>
